Release 10.1A: OpenEdge Development:
Progress 4GL Reference


QUOTER function

Converts the specified data type to CHARACTER and encloses the results in quotes when necessary.

The QUOTER function is intended for use in QUERY-PREPARE where a character predicate must be created from a concatenated list of string variables to form a WHERE clause. In order to process variables, screen values, and input values so that they are suitable for a query WHERE clause, it is often necessary to enclose them in quotes. For example, European-format decimals and character variables must always be enclosed in quotes. You can use the Quoter function to meet that requirement.

Syntax

QUOTER (<expression> [, <quote-char> [ , <null-string> ]]) 

expression

An expression in the data type that you want to convert to character and enclose with quotes.

quote-char

Either a single or double quote, enclosed in the opposite: "'" or '"'. The default is double quote. Passing ? for this argument results in double quotes.

null-string

The string you want for an unknown value: the word NULL or "" for example. The default is an unquoted question mark, which is the Unknown value (?).

For example, the following:

 DEFINE VARIABLE mychar As CHARACTER INITIAL "Lift Line Skiing". 
     ….. 
     qhandle:QUERY-PREPARE( "FOR EACH customer WHERE name = "  + 
QUOTER(mychar)) 

Would produce this prepare-string:

FOR EACH customer WHERE name = "Lift Line Skiing". 

Notes


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095